<?php
include "../../Koneksi/koneksi.php";

$nip = $_POST['nip'];
$namaPendidik = $_POST['namaPendidik'];
$namaPendidik_Sekolah = $_POST['namaPendidik_Sekolah'];


$cek = mysql_fetch_array(mysql_query("SELECT nip FROM pendidik WHERE nip='$nip'"));
if (empty($cek['nip'])) {
    mysql_query("insert into pendidik (nip, nama, sekolah) value "
            . "('$nip' ,'$namaPendidik' ,"
            . "1)");
    $result = header('location:../Form/FormPendidik.php');
} else {
    ?>
    <script>alert("Data Sudah Pernah Diinputkan");
                    document.location.href = "../Form/FormPendidik.php"</script>
    <?php
}

echo $result;
?>